﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components.secretary {
    import flash.display.*;
    import flash.events.*;
    
    import net.wooga.pets.constants.*;
    
    import org.robotlegs.mvcs.*;

    public class ReceptionSecretaryMediator extends Mediator {

        private var _view:MovieClip;
        private var _stateContext:ReceptionSecretaryViewStateManager;

        public static const LINKAGE_NAME:String = "ReceptionSecretary";

		[Inject]
        public function set view(_arg1:MovieClip):void{
            this._view = _arg1;
        }
        override public function preRegister():void{
            super.preRegister();
            this._stateContext = new ReceptionSecretaryViewStateManager();
            this._stateContext.initialize(this.getTimeline());
        }
        override public function onRegister():void{
            super.onRegister();
            this.eventMap.mapListener(eventDispatcher, EventConstants.INIT_WORLD_COMPLETE, this.onInitWorldComplete);
            this.eventMap.mapListener(eventDispatcher, EventConstants.SHOW_RECEPTION_BUBBLE, this.onPatientTalkingToSecretary);
            this.eventMap.mapListener(eventDispatcher, EventConstants.ON_PATIENT_ACCEPTED, this.onPatientStopToSecretary);
            this.eventMap.mapListener(eventDispatcher, EventConstants.ON_PATIENT_REJECTED, this.onPatientStopToSecretary);
        }
        override public function preRemove():void{
            super.preRemove();
            this._stateContext.destroy();
            this._stateContext = null;
        }
        private function onInitWorldComplete(_arg1:Event):void{
            this._stateContext.doIdle();
        }
        private function onPatientTalkingToSecretary(_arg1:Event):void{
            this._stateContext.doListening();
        }
        private function onPatientStopToSecretary(_arg1:Event):void{
            this._stateContext.doIdle();
        }
        private function getTimeline():MovieClip{
            return (this._view);
        }

    }
}//package net.wooga.pets.views.components.secretary 
